<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id = "app">
        <!-- 1、.prevent 阻止默认行为 -->
        <!-- 当我点击提交的时候，是通过一个方法来给我提交的，而不是默认的提交 -->
        <form action="baidu">
            <input type="submit" value="提交" @click.prevent="submintClick">
        </form>

        <!-- 2、监听某个键盘的键的值 -->
        <input type="text" @keyup.enter="keyup">

        <!-- 3、.once只触发一次回调 -->
    

    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!'
            },
            methods:{
                submintClick(){
                    console.log("tijiao");
                },
                keyup(){
                    console.log(111);
                }
               

            }
        })

    </script>
</body>

</html>